package com.duan.springboot.springbootlearning.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 用户controller
 *
 * @author duanjw
 */
@Controller
public class UserController {
    @GetMapping("show")
    @ResponseBody
    public String show() {
        return "hello";
    }
    @GetMapping("index")
    @ResponseBody
    public String index() {
        return "index";
    }

    /**
     * 测试日期
     * @param date
     * @return
     */
    @GetMapping("date")
    @ResponseBody
    public Date date(Date date) {
        return date;
    }
}
